<%--
 *  File:    BeforeVisitPlanHeaderEdit.jsp
 *  @Author: jackwang
 *  Date:    3/28/2002 17:10
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not

 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>



<% //--------------------------------------  setting logger --%>
<%
  
%>
<% //--------------------------------------  variant and initialization --%>
<%
	String strModuleName = "CRM";
    String strTableName = "";
	String privilegeCode = "H0259,H0260";
    HashMap userinfo = (HashMap)session.getAttribute("userinfo");
%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/InitEdit.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<html>
<head>
<title>BeforeVisitPlanHeaderEdit</title>
<%
	String strIsDefault = "";
	if("Y".equals(request.getParameter("isdefault"))) {
		strIsDefault = "&isdefault=Y";
	}else if ("N".equals(request.getParameter("isdefault"))) {
		strIsDefault = "&isdefault=N";
	}else  {
		strIsDefault = null;
	}
	
	

	String isNew = "";
	if("Y".equals(request.getParameter("isNew"))) {
		isNew = "&isNew=Y";
	}else if ("N".equals(request.getParameter("isNew"))) {
		isNew = "&isNew=N";
	}
	StringBuffer strParams=new StringBuffer();
	if(request.getParameter("year")!=null)
	{
		strParams.append("&year=").append(request.getParameter("year"));
	}else{
		strParams.append("&year=").append(pageContext.getAttribute("year"));
	}
	if(request.getParameter("monthofyear")!=null)
	{
		strParams.append("&monthofyear=").append(request.getParameter("monthofyear"));
	}else{
		strParams.append("&monthofyear=").append(pageContext.getAttribute("monthofyear"));
	} 
	if(request.getParameter("weekofmonth")!=null)
	{
		 strParams.append("&weekofmonth=").append(request.getParameter("weekofmonth"));
	}else{
		strParams.append("&weekofmonth=").append(pageContext.getAttribute("weekofmonth"));
	} 
	if(request.getParameter("dayofweek")!=null)
	{
		 strParams.append("&dayofweek=").append(request.getParameter("dayofweek"));
	} else{
		strParams.append("&dayofweek=").append(pageContext.getAttribute("dayofweek"));
	}
	if(request.getParameter("dayofmonth")!=null)
	{
		 strParams.append("&dayofmonth=").append(request.getParameter("dayofmonth"));
	}else{
		strParams.append("&dayofmonth=").append(pageContext.getAttribute("dayofmonth"));
	} 
	if(request.getParameter("customerid")!=null)
	{
		 strParams.append("&customerid=").append(request.getParameter("customerid"));
	} else{
		strParams.append("&customerid=").append(pageContext.getAttribute("customerid"));
	}
	if(request.getParameter("processid")!=null)
	{
		 strParams.append("&processid=").append(request.getParameter("processid"));
	} else{
		strParams.append("&processid=").append(pageContext.getAttribute("processid"));
	}
	if(request.getParameter("uprocessid")!=null)
	{
		 strParams.append("&uprocessid=").append(request.getParameter("uprocessid"));
	} else{
		strParams.append("&uprocessid=").append(pageContext.getAttribute("uprocessid"));
	}
	if(request.getParameter("contactid")!=null)
	{
		 strParams.append("&contactid=").append(request.getParameter("contactid"));
	}else{
		strParams.append("&contactid=").append(pageContext.getAttribute("contactid"));
	}
	if(request.getParameter("globalpccode")!=null)
	{
		 strParams.append("&globalpccode=").append(request.getParameter("globalpccode"));
	}else{
		strParams.append("&globalpccode=").append(pageContext.getAttribute("globalpccode"));
	}
	if(request.getParameter("vflag")!=null)
	{
		 strParams.append("&vflag=").append(request.getParameter("vflag"));
	}else{
		strParams.append("&vflag=").append(pageContext.getAttribute("vflag"));
	}
	 strParams.append("&orgid=").append(1);
	 //System.out.print(strParams);
	String globalpccode=null;
    if(request.getParameter("globalpccode")!=null)
	{
    	globalpccode=(String)request.getParameter("globalpccode");
	}else{
		globalpccode=(String)pageContext.getAttribute("globalpccode");
	}
    //System.out.print("strParams="+strParams);
    
    String processid=new String();
    String uprocessid=new String();
	if(request.getParameter("processid")!=null)
	{
		processid=(String)request.getParameter("processid");
	} else{
		processid=((Integer)pageContext.getAttribute("processid")).toString();
	}
	
	if(request.getParameter("uprocessid")==null)
	{
		uprocessid=((Integer)pageContext.getAttribute("uprocessid")).toString();
	} else{
		uprocessid=(String)request.getParameter("uprocessid");
		
	}
	//System.out.print(uprocessid);
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/<%= strLanguageCode %>/main.css" type="text/css">
 <script language="JavaScript" src="../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../js/FuncLib.js"></script>
<script language="JavaScript">
function page_detail(action) {
  var alldocuments = window.parent.frames;
  var url = "";
    /*
    if (action == "detail"){
	  url = "VisitProcessDetailEdit.jsp?<%=OvalTools.randomURL() %><%=strParams.toString()%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%>&isdetail=Y";
    }
	if(action=="prod"){
		url = "VisitProcessProdEdit.jsp?<%=OvalTools.randomURL() %><%=strParams.toString()%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%>";
	}
	*/
	//var globalpccode=<%=globalpccode %>;
	url="BeforeVisitPlanFeedbackDetail114.jsp?ishistory=<custom:write property='ishistory'/>";
	url=url+"<%=strParams%>";
	parent.down.location.href=url;
}

function page_main(action) {
  var url = "";
  if (action == "main"){
	  url = "BeforeVisitPlanMain.jsp?<%= OvalTools.randomURL() %><%=strParams.toString()%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%>"
  parent.down.location.href=url;
  }
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
	<form name="kform" method="post" action="../../Dispatcher">
			<%@ include file="/inc/PageLocation.inc" %>
    <input type="hidden" name="actionname">

    <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
    <custom:hidden property="contactid"/>
    <custom:hidden property="customerid" />
    <custom:hidden property="orgid" value="1"/>
    <custom:hidden property="ishistory"/>	
    <custom:hidden property="year"/>
    <custom:hidden property="monthofyear"/>
    <custom:hidden property="weekofmonth"/>
    
    <custom:hidden property="dayofweek"/>
    <custom:hidden property="processid"/>
    <custom:hidden property="uprocessid"/>
    <custom:hidden property="globalpccode"/>	
    <custom:hidden property="vflag"/>
    
    

<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td style="PADDING-BOTTOM: 0px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 0px" class="black_line">
            <table border=0 cellpadding=0 cellspacing=0
            width="100%">

            <tbody>
            <tr>
             <td bgcolor=#FFFFFF class=m_title>&nbsp;</td>
             </tr>
             <tr>
             <td background=../../images/<%= strLanguageCode %>/M_bg.gif  bgcolor=#FFFFFF valign="bottom">
              <table border="0" cellspacing="0" cellpadding="0">
            <tr>
            <td><img src="images/<%= strLanguageCode %>/M_bg.gif" width="1" height="20"></td>
            <%
             //System.out.print("processid="+processid);
        	 if(processid != null && processid.length() != 0  && !(("null").equals(processid))){
            %>
            <td class="hand1" id="A01" valign="bottom"  width="82" background="../images/<%= strLanguageCode %>/mark_bg_sfe.gif"  onclick='javascript:page_main("main");switchTags(this);'><div align=center><%=label.getLabelName("L_CustomervisitPlan")%></div></td>
            <%} %>
            <%
            //System.out.print("uprocessid="+uprocessid);
           // System.out.print(uprocessid.equals("null"));
        	 if(uprocessid != null && uprocessid.length() != 0 && !(("null").equals(uprocessid)) ){
            %>
            <td class="hand1" id="A02"  valign="bottom"  width="82" background="../images/<%= strLanguageCode %>/mark_bg_sfe.gif" onclick='javascript:page_detail("detail");switchTags(this);'><div align=center><%=label.getLabelName("L_PeoplevisitPlan")%></div></td>
            <%} %>
           </tr>
           </table>
          </td>
        </tr>
		
      </table>
    </td>
  </tr>

</table>

  </form>
</body>
</html>


